package com.zhentao.controller;

import com.zhentao.entity.center.login.User;
import com.zhentao.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

@RequestMapping("account")
@RestController
public class UserMapperController {
    @Autowired
    private UserService userService;

    @RequestMapping("add")
    public String login(@RequestBody User user) {
        return userService.add(user);
    }

    @RequestMapping("del")
    public String del(@RequestParam("id") Integer id) {
        return userService.del(id);
    }

    @RequestMapping("sel")
    public User sel(@RequestParam("username") String username) {
        return userService.sel(username);
    }
}
